package com.heima.utils.thread;

import com.heima.model.admin.pojos.AdUser;
import com.heima.model.user.pojos.ApUser;

public class AdThreadLocalUtil {

    public static final ThreadLocal<AdUser> AD_USER_THREAD_LOCAL = new ThreadLocal<>();

    //    存入当前用户
    public static void setUser(AdUser adUser) {
        AD_USER_THREAD_LOCAL.set(adUser);
    }

    //    得到当前用户id
    public static AdUser getUser() {
        return AD_USER_THREAD_LOCAL.get();
    }

    //    删除用户
    public static void remove() {
        AD_USER_THREAD_LOCAL.remove();
    }
}
